package com.tbit.common.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;

/**
 * tbit 属性配置
 *
 * @author yao
 * @since 2024/1/16 15:23
 */
@Validated
@Component
public class TbitProperties {

    private static String url;

    @Value("${tbit.url}")
    @NotBlank(message = "地址不能为空")
    public void setUrl(final String url) {
        TbitProperties.url = url;
    }

    public static String getUrl() {
        return TbitProperties.url;
    }

}
